import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { TagItem } from '@iux/live';

@Component({
  selector: 'app-removable',
  templateUrl: './removable.component.html',
  styles: [],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class RemovableComponent implements OnInit {

  data: TagItem[];

  constructor() {
  }

  ngOnInit() {
    this.initData();
  }

  initData() {
    this.data = this.initTag(10);
  }

  initTag(length: number = 10) {
    return Array.from({ length }).map((item, key) => ({
      label: key !== 3 ? `Tag${key + 1}` : `Tag${key + 1}very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,very long,`,
      removable: true,
      disabled: key === 4,
    }));
  }
}
